<template>
  <div class="gallary" @click.stop="closeGallary()">
    <div class="wrapper">
      <swiper :options="swiperOption" class="swiper">
      <!-- slides -->
        <swiper-slide v-for="img in gallaryImgs" :key="img">
          <img :src="img" alt="" width="100%">
        </swiper-slide>
        <!-- Optional controls -->
        <div class="swiper-pagination"  slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>

<script>
import { swiper, swiperSlide } from 'vue-awesome-swiper'

export default {
  name: 'Gallary',
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        paginationType: 'fraction'
      }
    }
  },
  props: {
    gallaryImgs: Array
  },
  methods: {
    closeGallary () {
      this.$emit('close')
    }
  },
  components: {
    swiper,
    swiperSlide
  }
}
</script>

<style lang="stylus" scoped>
.gallary >>> .swiper-pagination
  color #fff 
  font-size .24rem
.gallary
  position fixed
  left 0
  top 0
  bottom 0
  right 0
  background #000
  z-index 99
  display flex
  flex-direction column
  justify-content center
  .wrapper
    width 100%
  .swiper-container
    overflow inherit
    .swiper-pagination
      bottom -1rem

  
</style>